package edu.whut.mall.portal.domain;

import lombok.Data;

import javax.validation.constraints.NotNull;

/**
* @program: d9lab-mall
* @description: 团购订单参数类
* @author:  Wayne
* @create: 2020-05-21 16:15:55
**/
@Data
public class GroupBuyOrderParams {
    /* ------------------------团购规则和团购记录id只能出现一个-----------------------------------
    /**
     * 团购规则id
     */
    private Long groupBuyRuleId;

    /**
     * 团购记录id
     */
    private Long groupBuyRecordId;
    /* ------------------------只能出现一个-----------------------------------

    /**
     * 团购人员的类型 参与者、发起者
     */
    @NotNull
    private Integer userType;

    public static GroupBuyOrderParams extractGroupOrderAttach(PayInfoParams payInfoParams) {
        GroupBuyOrderParams groupBuyOrderParams = new GroupBuyOrderParams();
        groupBuyOrderParams.setGroupBuyRecordId(payInfoParams.getGroupBuyRecordId());
        groupBuyOrderParams.setGroupBuyRuleId(payInfoParams.getGroupBuyRuleId());
        groupBuyOrderParams.setUserType(payInfoParams.getUserType());
        return groupBuyOrderParams;
    }



}